export function optionLabel (value, optionKey) {
  console.log(optionKey);
  for (const item of options[optionKey]) {
    if (item.value + '' === value + '') {
      return item.label
    }
  }
  return ''
}
export function clasNameFilters(className, gradeType){
	let set = {1: "[婴]", 2: "[小]", 3: "[大]"};
	return className + (set.hasOwnProperty(gradeType) ? set[gradeType] : '')
}
export function birthdayToAge (birthday) {
  if(birthday == '' || birthday == null || birthday == undefined || birthday == '')
    return '';
  let birthdayNew = birthday.replace(/-/g, "/");
  var d = new Date(birthdayNew);
  if (isNaN(d)) return '';
  let birthday_time_stamp = Number(new Date(birthdayNew));
  let newTime = Number(new Date());
  let difference = newTime - birthday_time_stamp;
  let age = difference / 31536000000; // 一年的秒数
  if (age >= 1) {
  	age = parseInt(age * 12);
    let Y = parseInt(age / 12);
    let mm = parseInt(age % 12) + 1;
    let results = Y + "岁";
    if(mm > 0){
        results += (mm + "个月");
    }
    return results
  } else {
    let mm = parseInt(age*12)
    let results = mm + "个月";
    return results
  }
}
